package com.hsy.crm.web.domain.entity;

import javax.persistence.Column;
import javax.persistence.Table;

/**
 * 系统参数
 *
 * 字典表不分开 所有用户公用
 *
 */
@Table(name = "sys_dict")
public class Dict extends BaseEntity{

    @Column(length = 10)
    private Long code;

    @Column(length = 11)
    private Integer value;

    /**
     * 字典类型 0 系统字典，用户不可修改  1用户字典  用户可修改
     */
    @Column(length = 11)
    private Integer type;

    @Column(length = 11)
    private Integer ord;

    @Column(length = 50)
    private String comments;


    public Dict(Long code, String customerId) {
        this.code = code;
        this.setCustomerId(customerId);
    }

    public Integer getOrd() {
        return ord;
    }

    public void setOrd(Integer ord) {
        this.ord = ord;
    }

    public Dict() {
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getCode() {
        return code;
    }

    public void setCode(Long code) {
        this.code = code;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public Dict toPageDict(){
        Dict dict = new Dict();
        dict.setCode(this.getCode());
        dict.setValue(this.getValue());
        dict.setComments(this.getComments());
        dict.setId(this.getId());
        return dict;
    }

    @Override
    public String getDynamicTableName() {
        return "sys_dict";
    }
}
